<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMeetOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('meet_orders', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('自增ID');
            $table->unsignedBigInteger('meet_hour_id')->comment('场馆小时id')->index();
            $table->unsignedBigInteger('meet_person_id')->comment('预约人id')->index();
            $table->unsignedBigInteger('venue_id')->comment('场馆id');

            $table->unsignedTinyInteger('audit_status')->default(0)->comment('审核状态 0:待审核 1:已审核 2:拒绝 3:取消');

            $table->unsignedBigInteger('add_uid')->comment('添加者uid')->index();

            $table->timestamps();
            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
        DB::statement("alter table `meet_orders` comment'场馆预约审核表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('meet_orders');
    }
}
